<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>在线选号平台</title>
		<link href="css/style.css" rel="stylesheet" type="text/css" />
		<link href="css/win.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="../js/jquery-1.7.min.js"></script>
		<script type="text/javascript" src="../js/jquery.cookie.js"></script>
		<script type="text/javascript" src="../js/logon.js"></script>
		<script language="javascript" type="text/javascript">
		function modPwd()
		{
			var oldPwd =$.trim($("#oldPwd").val());
			$("#oldPwd").val(oldPwd);
			if(oldPwd.length==0)
			{
				$("#error").text("请输入原密码！");
				return;
			}
			
			var newPwd =$.trim($("#newPwd").val());
			$("#newPwd").val(newPwd);
			if(newPwd.length==0)
			{
				$("#error").text("请输入请密码！");
				return;
			}
			if(newPwd.length<5)
			{
				$("#error").text("密码长度必须大于5！");
				return;
			}
			
			var secPwd =$.trim($("#secPwd").val());
			$("#secPwd").val(secPwd);
			if(secPwd!=newPwd)
			{
				$("#error").text("两次输入的密码不一样！");
				return;
			}
			
			$("#pwdform").action="/modpwd";
			$("#pwdform").target="_self";
			$("#pwdform").submit();
		}
		var max = 5;
		function ret()
		{
			if(max>0)
			{
				$("#sec").text(max);
				--max;
			}
			else
			{
				clearInterval(timer);
				$.cookie("mpa_token", "", {path:"/", expires:-1}); // 删除 cookie
				window.location.href="/login";
			}
		}
		#if($!{model.get("ret")}==1)
		timer = setInterval("ret()",1000);
		#end
	</script>
	</head>

	<body>
		#include("header.html")
		<table width="100%" border="0" cellspacing="0" cellpadding="0" id="content">
		<tr>
			#if($!{model.get("user").role}==1)
				<td valign="top" id="menu">
				#include("menu_admin.html")
			#elseif($!{model.get("user").role}==2)
				<td valign="top" id="left">
				#include("menu_operate.html")
			#elseif($!{model.get("user").role}==3)
				<td valign="top" id="left">
				#include("menu_sale.html")
			#elseif($!{model.get("user").role}==4)
				<td valign="top" id="left">
				#include("menu_manager.html")
			#end
			</td>
			<td id="right">
				<div id="list" style="margin-top: 0;">
					<div class="title"><span>修改密码</span></div>
					<div class="info">
						<form id="pwdform" name="pwdform" action="/modpwd" method="post">
							<table width="100%" border="0" cellspacing="0" cellpadding="0">
								<tr>
									<td height="533" colspan="7" align="center" valign="top">
										<table border="0" cellspacing="0" cellpadding="5">
											<tr>
												<td colspan="2" align="center">
													<p id="error" style="float: left; color: #CC0000; padding-left: 20px; height: 20px; line-height: 20px;">$!{model.get("error")}</p>
												</td>
											</tr>
											<tr>
												<td align="right">输入原密码</td>
												<td>
													<input type="password" id="oldPwd" name="oldPwd" class="login_input" style="width: 200px;" maxlength="16" />
													<span class="red">*</span>必填
												</td>
											</tr>
											<tr>
												<td align="right">输入新密码</td>
												<td>
													<input type="password" id="newPwd" name="newPwd" class="login_input" style="width: 200px;" maxlength="16" />
													<span class="red"> *</span>必填
												</td>
											</tr>
											<tr>
												<td align="right">再次输入新密码</td>
												<td>
													<input type="password" id="secPwd" name="secPwd" class="login_input" style="width: 200px;" maxlength="16" />
													<span class="red">*</span>必填
												</td>
											</tr>
											<tr>
												<td>&nbsp;</td>
												<td>
													<input type="button" name="Submit" value="确定修改" class="order_btn" onclick="modPwd();" />
												</td>
											</tr>
										</table>
									</td>
								</tr>
							</table>
						</form>
					</div>
				</div>
				</td></tr></table>
		#include("footer.html")
	</body>
</html>
